package hn.cch.reactive.configuration;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import hn.cch.reactive.entity.Message;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CacheConfiguration {


    @Bean(value = "messageCache")
    public Cache<String, Message> messageCache() {
        Cache<String, Message> cache = Caffeine.newBuilder().build();
        return cache;
    }

    @Bean(value = "objectCache")
    public Cache<String, Object> objectCache() {
        Cache<String, Object> cache = Caffeine.newBuilder().build();
        return cache;
    }


}
